{{ define "content" }}
{{- $basePath := strings.TrimSuffix "/" (default "/archives" .Site.Params.archive.basePath) -}}
{{- $basePath = printf "%s/" (strings.TrimPrefix "/" $basePath)  -}}
{{- $baseURL := absURL $basePath -}}
{{- if gt (len $.Site.Home.AllTranslations) 1 -}}
  {{- $baseURL = absLangURL (printf "%s/" $basePath) -}}
{{- end -}}
{{- $path := replace .Permalink $baseURL "" -}}
{{- $date := split $path "/" -}}
{{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}}
<div class="{{ if default true .Params.sidebar }}col-xxl-8{{ else }}col-xxl-12{{ end }} mb-4">
  <div class="container">
    {{- partial "breadcrumb" . -}}
    <div class="archives border-3 border-start ps-3">
      {{- if index $date 0 -}}
        {{- partial "archives/year" (dict "page" . "pages" $pages "year" (index $date 0)) -}}
      {{- else -}}
        {{- partial "archives/list" (dict "page" . "pages" $pages "basePath" $basePath) -}}
      {{- end -}}
    </div>
  </div>
</div>
{{- partial "sidebar" . -}}
{{ end }}
